package com.neutech.controller;

import com.neutech.service.DepartmentService;
import com.neutech.service.PayrecordService;
import com.neutech.service.SchedulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
public class PayrecordController {
//    @Autowired
//    private MenuService menuService;
    /*******************医生___START*************************/
    @Autowired
    private PayrecordService payrecordService;
    @RequestMapping("/queryPayrecord")
    public List<Map<String,Object>> getPayrecord(){
        return payrecordService.queryPayrecord();
    }
    @RequestMapping("/insertPayrecord")
    public void insPayrecord(@RequestParam Map  map){
        payrecordService.insertPayrecord(map);
        System.out.println(map.get("oid"));
    }
    @RequestMapping("/deletePayrecord")
    public void delPayrecord(@RequestParam Map  map){
        payrecordService.deletePayrecord(map);
        System.out.println(map.get("oid"));
    }
    @RequestMapping("/updataPayrecord")
    public void updPayrecord(@RequestParam Map  map){
//        System.out.println("看这里");
//        System.out.println(map);
//        System.out.println("看这里");
        Map<String,Object> map2 = new HashMap<>();
        map2.put("oid",map.get("oid"));
        map2.put("otype",map.get("otype"));
        map2.put("oname",map.get("oname"));
        map2.put("state",map.get("state"));
        map2.put("cost",map.get("cost"));
        map2.put("paytime",map.get("paytime"));
        map2.put("patid",map.get("patid"));

        payrecordService.updataPayrecord(map2);
    }
    /**************************END*******************************/

}
